using System;
using UnityEngine;
using UnityEngine.Events;

public class PlayerPrefsIntEvent : MonoBehaviour
{
	[Serializable]
	public class Unit
	{
		public string playerPrefsName;

		public int valueCondition;

		public UnityEvent callback;
	}

	public Unit[] units;

	private void Awake()
	{
		Unit[] array = units;
		foreach (Unit unit in array)
		{
			if (unit.valueCondition == PlayerPrefs.GetInt(unit.playerPrefsName))
			{
				unit.callback?.Invoke();
			}
		}
	}
}
